@marimo-team/frontend 0.23.16-dev51 → 0.23.16-dev53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/assets/{CellStatus-DciB5rbr.js → CellStatus-BfPw99P2.js} +1 -1
  2. package/dist/assets/{JsonOutput-BM3vve9F.js → JsonOutput-E3o1Uk0e.js} +12 -12
  3. package/dist/assets/{MarimoErrorOutput-Bh0y53Du.js → MarimoErrorOutput-D9Dypu7Q.js} +4 -4
  4. package/dist/assets/{RenderHTML-B9jx7Dsm.js → RenderHTML-DRJxD5FQ.js} +1 -1
  5. package/dist/assets/{RunButton-DMtHbFuA.js → RunButton-y7Y9rjmF.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-BcRYriMM.js → add-cell-with-ai-ByfOWv0Z.js} +12 -12
  7. package/dist/assets/add-connection-dialog-DVSFAYXK.js +178 -0
  8. package/dist/assets/{agent-panel-B31W_VwU.js → agent-panel-B2OKzocQ.js} +4 -4
  9. package/dist/assets/{ai-model-dropdown-B3D05oQh.js → ai-model-dropdown-Dr2QbDlZ.js} +3 -3
  10. package/dist/assets/{app-config-button-D_mjovwU.js → app-config-button-DScmpqcV.js} +1 -1
  11. package/dist/assets/{blob-BJREJiQp.js → blob-BXcsY70H.js} +1 -1
  12. package/dist/assets/{cell-editor-BOhZHoLm.js → cell-editor-BuGvBHQI.js} +11 -11
  13. package/dist/assets/cell-link-DGv7Q4Mc.js +1 -0
  14. package/dist/assets/{cells-Jr-5Pc9f.js → cells-CMc2NsXm.js} +61 -61
  15. package/dist/assets/{chat-display-Djy1Jt6b.js → chat-display-CeQftKrl.js} +1 -1
  16. package/dist/assets/{chat-panel-B2nYSE_l.js → chat-panel-BP5hfvS7.js} +4 -4
  17. package/dist/assets/{chat-ui-DlG0En7w.js → chat-ui-DoA0lexh.js} +4 -4
  18. package/dist/assets/{column-preview-BUHlI5va.js → column-preview-BeR1SI6Z.js} +1 -1
  19. package/dist/assets/{command-palette-rEJmXCZM.js → command-palette-DZSYeVCO.js} +1 -1
  20. package/dist/assets/{common-CZc3fQI4.js → common-NWgkp5L1.js} +1 -1
  21. package/dist/assets/{components-GAYCj6Mx.js → components-Mbf0MEIC.js} +1 -1
  22. package/dist/assets/{datasource-AWkkAeiS.js → datasource-Wt8yUynT.js} +2 -2
  23. package/dist/assets/{dependency-graph-panel-wcqTPq6b.js → dependency-graph-panel-B7TXWKYs.js} +4 -4
  24. package/dist/assets/{documentation-panel-Eu8MIkoU.js → documentation-panel-D9MZUKaD.js} +1 -1
  25. package/dist/assets/{download-CQ7iZFJL.js → download-U_wgQ8mC.js} +2 -2
  26. package/dist/assets/{edit-page-Cw7nN6HC.js → edit-page-BBc9BGYT.js} +6 -6
  27. package/dist/assets/error-entries-Bs30Z6uG.js +8 -0
  28. package/dist/assets/{error-panel-BZzr0PA1.js → error-panel-KY679tDx.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-C1W7g_Wp.js → file-explorer-panel-9y0hzNAa.js} +4 -4
  30. package/dist/assets/{file-icons-BAqZR08W.js → file-icons-D5l3kSYq.js} +1 -1
  31. package/dist/assets/{file-name-input-0MiZVw5r.js → file-name-input-D_xhjKFp.js} +1 -1
  32. package/dist/assets/{floating-outline-C6g75zrP.js → floating-outline-BdgJT2B9.js} +1 -1
  33. package/dist/assets/{focus-C0HXXg3V.js → focus-D64hL1tZ.js} +1 -1
  34. package/dist/assets/{form-DT44Rmhp.js → form-CoqwGbkO.js} +1 -1
  35. package/dist/assets/{form-C051zAev.js → form-b4jQBV3T.js} +1 -1
  36. package/dist/assets/{home-page-CJz9IHZ2.js → home-page-tVWY9YdF.js} +2 -2
  37. package/dist/assets/{html-to-image-CfjhKLA4.js → html-to-image-Dm7huiQj.js} +2 -2
  38. package/dist/assets/index-8Nlyq3mV.css +2 -0
  39. package/dist/assets/{index-CrEgp1mR.js → index-Dz8dLbnI.js} +6 -6
  40. package/dist/assets/{layout-D4bpsgVD.js → layout-DKUs0ozP.js} +5 -5
  41. package/dist/assets/{logs-panel-CsaY3O1m.js → logs-panel-BzS7VSh0.js} +1 -1
  42. package/dist/assets/{markdown-renderer-BgqeO4JR.js → markdown-renderer-uWTrQId1.js} +2 -2
  43. package/dist/assets/{name-cell-input-DcU8Rfrz.js → name-cell-input-BgxcWTfV.js} +1 -1
  44. package/dist/assets/{outline-panel-D-CHPZQM.js → outline-panel-BT3zzwfa.js} +1 -1
  45. package/dist/assets/{packages-panel-dq7QVZl1.js → packages-panel-BKfeGuve.js} +1 -1
  46. package/dist/assets/panels-4jSJxEYp.js +4 -0
  47. package/dist/assets/{process-output-NbwnUu05.js → process-output-DE8TTXPC.js} +1 -1
  48. package/dist/assets/{radio-group-rhQpGwU-.js → radio-group-Da80KtoT.js} +1 -1
  49. package/dist/assets/readonly-code-display-B8zhuSov.js +1 -0
  50. package/dist/assets/{readonly-python-code-Q_1Y3VyZ.js → readonly-python-code-Bmo6cMSq.js} +1 -1
  51. package/dist/assets/{reveal-component-CedpDwM8.js → reveal-component-Cv7WZ4r6.js} +2 -2
  52. package/dist/assets/{run-page-CGoux5cj.js → run-page-CA21zsME.js} +1 -1
  53. package/dist/assets/scratchpad-panel-Br7RFJkK.js +1 -0
  54. package/dist/assets/{session-panel-OIot3eyB.js → session-panel-BiUht4zM.js} +1 -1
  55. package/dist/assets/{skeleton-BRvjFlRu.js → skeleton-CY-B1asm.js} +1 -1
  56. package/dist/assets/{snippets-panel-YFyH2hUM.js → snippets-panel-CjiTlCpD.js} +1 -1
  57. package/dist/assets/{state-bHyw5u3R.js → state-BJ7IdtXW.js} +1 -1
  58. package/dist/assets/state-TgAqts79.js +3 -0
  59. package/dist/assets/{tracing-CDMM1BB2.js → tracing-DmQ7KQ3A.js} +1 -1
  60. package/dist/assets/{tracing-panel-BH5Zbvl9.js → tracing-panel-C1TOV9kj.js} +2 -2
  61. package/dist/assets/{tree-actions-DDveUIHK.js → tree-actions-enwITSy7.js} +1 -1
  62. package/dist/assets/useCellActionButton-CXvU9GmI.js +1 -0
  63. package/dist/assets/{useDeleteCell-BIopCngo.js → useDeleteCell-Bp3S6pL8.js} +1 -1
  64. package/dist/assets/{useDependencyPanelTab-snM337f9.js → useDependencyPanelTab-CewYv8cP.js} +1 -1
  65. package/dist/assets/{useNotebookActions-CsZfWFKy.js → useNotebookActions-l9NAqPKm.js} +4 -4
  66. package/dist/assets/useRunCells-B-KIwrVZ.js +1 -0
  67. package/dist/assets/{useSplitCell-BTmKY1CU.js → useSplitCell-B0jvSFsl.js} +1 -1
  68. package/dist/index.html +24 -24
  69. package/package.json +1 -1
  70. package/src/__mocks__/requests.ts +1 -0
  71. package/src/components/editor/connections/__tests__/quick-add-data-sources.test.tsx +113 -0
  72. package/src/components/editor/connections/add-connection-dialog.tsx +2 -0
  73. package/src/components/editor/connections/quick-add-data-sources.tsx +106 -0
  74. package/src/core/codemirror/language/__tests__/sql.test.ts +191 -7
  75. package/src/core/codemirror/language/languages/sql/sql.ts +41 -13
  76. package/src/core/datasets/data-source-discovery.ts +5 -0
  77. package/src/core/datasets/request-registry.ts +11 -0
  78. package/src/core/islands/bootstrap.ts +1 -0
  79. package/src/core/islands/bridge.ts +1 -0
  80. package/src/core/kernel/messages.ts +2 -0
  81. package/src/core/network/__tests__/requests-lazy.test.ts +15 -0
  82. package/src/core/network/__tests__/requests-network.test.ts +14 -0
  83. package/src/core/network/requests-lazy.ts +1 -0
  84. package/src/core/network/requests-network.ts +8 -0
  85. package/src/core/network/requests-static.ts +1 -0
  86. package/src/core/network/requests-toasting.tsx +1 -0
  87. package/src/core/network/types.ts +2 -0
  88. package/src/core/wasm/bridge.ts +10 -0
  89. package/src/core/websocket/useMarimoKernelConnection.tsx +4 -0
  90. package/src/hooks/__tests__/useDataSourceDiscovery.test.ts +80 -0
  91. package/src/hooks/useDataSourceDiscovery.ts +18 -0
  92. package/dist/assets/add-connection-dialog-syjRSNPT.js +0 -178
  93. package/dist/assets/cell-link-DqNEv3f9.js +0 -1
  94. package/dist/assets/error-entries-Cr8uVukN.js +0 -8
  95. package/dist/assets/index-D6Dp_PFj.css +0 -2
  96. package/dist/assets/panels-DWoniKhE.js +0 -4
  97. package/dist/assets/readonly-code-display-CVY2f7EZ.js +0 -1
  98. package/dist/assets/scratchpad-panel-BLuF25yR.js +0 -1
  99. package/dist/assets/state-DB_fxbhn.js +0 -3
  100. package/dist/assets/useCellActionButton-D5ix_g2a.js +0 -1
  101. package/dist/assets/useRunCells-CF_V8X2K.js +0 -1
@@ -1 +1 @@
1
- import{s as H}from"./chunk-LvLJmgfZ.js";import{t as z}from"./react-Bj1aDYRI.js";import{in as W,rn as R}from"./cells-Jr-5Pc9f.js";import{t as B}from"./compiler-runtime-B3qBwwSJ.js";import{g as L}from"./useEventListener-C0195JsF.js";import{t as V}from"./jsx-runtime-Blw4afVn.js";import{t as D}from"./tooltip-4bZlU7jl.js";import{t as k}from"./ban-DOUu3Y9Q.js";import{c as G,l as A,n as J,t as M}from"./toDate-Ct2FT81-.js";import{t as K}from"./ellipsis-C_B8Ux9M.js";import{t as Y}from"./refresh-cw-CYq4mK5a.js";import{t as Q}from"./workflow-e-XGaKyY.js";import{i as U,n as F,r as E,t as Z}from"./en-US-CjNeNXDB.js";import{t as O}from"./useDateFormatter-rtpVEy3J.js";import{t as I}from"./multi-icon-C2ijLyOs.js";function X(r,e){let t=M(r)-+M(e);return t<0?-1:t>0?1:t}function $(r){return J(r,Date.now())}function ee(r,e,t){let[d,l]=F(t==null?void 0:t.in,r,e),h=d.getFullYear()-l.getFullYear(),o=d.getMonth()-l.getMonth();return h*12+o}function te(r){return e=>{let t=(r?Math[r]:Math.trunc)(e);return t===0?0:t}}function se(r,e){return M(r)-+M(e)}function ae(r,e){let t=M(r,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function le(r,e){let t=M(r,e==null?void 0:e.in),d=t.getMonth();return t.setFullYear(t.getFullYear(),d+1,0),t.setHours(23,59,59,999),t}function ne(r,e){let t=M(r,e==null?void 0:e.in);return+ae(t,e)==+le(t,e)}function re(r,e,t){let[d,l,h]=F(t==null?void 0:t.in,r,r,e),o=X(l,h),b=Math.abs(ee(l,h));if(b<1)return 0;l.getMonth()===1&&l.getDate()>27&&l.setDate(30),l.setMonth(l.getMonth()-o*b);let m=X(l,h)===-o;ne(d)&&b===1&&X(d,h)===1&&(m=!1);let x=o*(b-+m);return x===0?0:x}function ie(r,e,t){let d=se(r,e)/1e3;return te(t==null?void 0:t.roundingMethod)(d)}function ce(r,e,t){let d=U(),l=(t==null?void 0:t.locale)??d.locale??Z,h=X(r,e);if(isNaN(h))throw RangeError("Invalid time value");let o=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:h}),[b,m]=F(t==null?void 0:t.in,...h>0?[e,r]:[r,e]),x=ie(m,b),_=(E(m)-E(b))/1e3,p=Math.round((x-_)/60),v;if(p<2)return t!=null&&t.includeSeconds?x<5?l.formatDistance("lessThanXSeconds",5,o):x<10?l.formatDistance("lessThanXSeconds",10,o):x<20?l.formatDistance("lessThanXSeconds",20,o):x<40?l.formatDistance("halfAMinute",0,o):x<60?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",1,o):p===0?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",p,o);if(p<45)return l.formatDistance("xMinutes",p,o);if(p<90)return l.formatDistance("aboutXHours",1,o);if(p<1440){let g=Math.round(p/60);return l.formatDistance("aboutXHours",g,o)}else{if(p<2520)return l.formatDistance("xDays",1,o);if(p<43200){let g=Math.round(p/G);return l.formatDistance("xDays",g,o)}else if(p<43200*2)return v=Math.round(p/A),l.formatDistance("aboutXMonths",v,o)}if(v=re(m,b),v<12){let g=Math.round(p/A);return l.formatDistance("xMonths",g,o)}else{let g=v%12,u=Math.trunc(v/12);return g<3?l.formatDistance("aboutXYears",u,o):g<9?l.formatDistance("overXYears",u,o):l.formatDistance("almostXYears",u+1,o)}}function oe(r,e){return ce(r,$(r),e)}var q=H(z(),1);function ue(r){let e=(0,q.useRef)(r),[t,d]=(0,q.useState)(r);return(0,q.useEffect)(()=>{let l=setInterval(()=>{d(R.now().toMilliseconds())},17);return()=>clearInterval(l)},[]),t-e.current}var P=B(),s=H(V(),1);const de=r=>{let e=(0,P.c)(79),{editing:t,status:d,disabled:l,staleInputs:h,edited:o,interrupted:b,elapsedTime:m,runStartTimestamp:x,lastRunStartTimestamp:_,uninstantiated:p}=r;if(!t)return null;let v=x??_,g;e[0]===v?g=e[1]:(g=v?(0,s.jsx)(me,{lastRanTime:v}):null,e[0]=v,e[1]=g);let u=g;if(l&&d==="running")return L.error("CellStatusComponent: disabled and running"),null;if(l&&h){let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is stale, but it's disabled and can't be run"}),e[2]=c):c=e[2];let a;e[3]===u?a=e[4]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[3]=u,e[4]=a);let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:(0,s.jsxs)(I,{children:[(0,s.jsx)(k,{className:"h-5 w-5",strokeWidth:1.5}),(0,s.jsx)(Y,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[5]=i):i=e[5];let n;return e[6]===a?n=e[7]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[6]=a,e[7]=n),n}if(l){let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is disabled"}),e[8]=c):c=e[8];let a;e[9]===u?a=e[10]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[9]=u,e[10]=a);let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-disabled","data-testid":"cell-status","data-status":"disabled",children:(0,s.jsx)(k,{className:"h-5 w-5",strokeWidth:1.5})}),e[11]=i):i=e[11];let n;return e[12]===a?n=e[13]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[12]=a,e[13]=n),n}if(!h&&d==="disabled-transitively"){let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"An ancestor of this cell is disabled, so it can't be run"}),e[14]=c):c=e[14];let a;e[15]===u?a=e[16]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[15]=u,e[16]=a);let i;e[17]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"disabled-transitively",children:(0,s.jsxs)(I,{layerTop:!0,children:[(0,s.jsx)(Q,{className:"h-5 w-5",strokeWidth:1.5}),(0,s.jsx)(k,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[17]=i):i=e[17];let n;return e[18]===a?n=e[19]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[18]=a,e[19]=n),n}if(h&&d==="disabled-transitively"){let c;e[20]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is stale, but an ancestor is disabled so it can't be run"}),e[20]=c):c=e[20];let a;e[21]===u?a=e[22]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[21]=u,e[22]=a);let i;e[23]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:(0,s.jsxs)(I,{children:[(0,s.jsx)(Y,{className:"h-5 w-5",strokeWidth:1}),(0,s.jsx)(k,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[23]=i):i=e[23];let n;return e[24]===a?n=e[25]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[24]=a,e[25]=n),n}if(d==="running"){let c;e[26]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is running"}),e[26]=c):c=e[26];let a;e[27]===u?a=e[28]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[27]=u,e[28]=a);let i;e[29]===x?i=e[30]:(i=R.fromSeconds(x)||R.now(),e[29]=x,e[30]=i);let n;e[31]===i?n=e[32]:(n=(0,s.jsx)("div",{className:"cell-status-icon elapsed-time running","data-testid":"cell-status","data-status":"running",children:(0,s.jsx)(he,{startTime:i})}),e[31]=i,e[32]=n);let f;return e[33]!==a||e[34]!==n?(f=(0,s.jsx)(D,{content:a,usePortal:!0,children:n}),e[33]=a,e[34]=n,e[35]=f):f=e[35],f}if(d==="queued"){let c;e[36]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is queued to run"}),e[36]=c):c=e[36];let a;e[37]===u?a=e[38]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[37]=u,e[38]=a);let i;e[39]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-queued","data-testid":"cell-status","data-status":"queued",children:(0,s.jsx)(K,{className:"h-5 w-5",strokeWidth:1.5})}),e[39]=i):i=e[39];let n;return e[40]===a?n=e[41]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[40]=a,e[41]=n),n}if(o||b||h||p){let c;e[42]===m?c=e[43]:(c=W(m),e[42]=m,e[43]=c);let a=c,i;e[44]!==m||e[45]!==a?(i=m?(0,s.jsx)(C,{elapsedTime:a}):null,e[44]=m,e[45]=a,e[46]=i):i=e[46];let n=i,f,T="";if(p)f="This cell has not yet been run";else if(b){f="This cell was interrupted when it was last run";let j;e[47]===n?j=e[48]:(j=(0,s.jsxs)("span",{children:["This cell ran for ",n," before being interrupted"]}),e[47]=n,e[48]=j),T=j}else if(o){f="This cell has been modified since it was last run";let j;e[49]===n?j=e[50]:(j=(0,s.jsxs)("span",{children:["This cell took ",n," to run"]}),e[49]=n,e[50]=j),T=j}else{f="This cell has not been run with the latest inputs";let j;e[51]===n?j=e[52]:(j=(0,s.jsxs)("span",{children:["This cell took ",n," to run"]}),e[51]=n,e[52]=j),T=j}let N;e[53]===Symbol.for("react.memo_cache_sentinel")?(N=(0,s.jsx)("div",{className:"cell-status-stale","data-testid":"cell-status","data-status":"outdated",children:(0,s.jsx)(Y,{className:"h-5 w-5",strokeWidth:1.5})}),e[53]=N):N=e[53];let S;e[54]===f?S=e[55]:(S=(0,s.jsx)(D,{content:f,usePortal:!0,children:N}),e[54]=f,e[55]=S);let y;e[56]!==m||e[57]!==a||e[58]!==u||e[59]!==T?(y=m&&(0,s.jsx)(D,{content:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[T,u]}),usePortal:!0,children:(0,s.jsx)("div",{className:"elapsed-time hover-action","data-testid":"cell-status","data-status":"outdated",children:(0,s.jsx)("span",{children:a})})}),e[56]=m,e[57]=a,e[58]=u,e[59]=T,e[60]=y):y=e[60];let w;return e[61]!==S||e[62]!==y?(w=(0,s.jsxs)("div",{className:"cell-status-icon flex items-center gap-2",children:[S,y]}),e[61]=S,e[62]=y,e[63]=w):w=e[63],w}if(m!==null){let c;e[64]===m?c=e[65]:(c=W(m),e[64]=m,e[65]=c);let a=c,i;e[66]!==m||e[67]!==a?(i=m?(0,s.jsx)(C,{elapsedTime:a}):null,e[66]=m,e[67]=a,e[68]=i):i=e[68];let n=i,f;e[69]===n?f=e[70]:(f=(0,s.jsxs)("span",{children:["This cell took ",n," to run"]}),e[69]=n,e[70]=f);let T;e[71]!==u||e[72]!==f?(T=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[f,u]}),e[71]=u,e[72]=f,e[73]=T):T=e[73];let N;e[74]===a?N=e[75]:(N=(0,s.jsx)("div",{className:"cell-status-icon elapsed-time hover-action","data-testid":"cell-status","data-status":"idle",children:(0,s.jsx)("span",{children:a})}),e[74]=a,e[75]=N);let S;return e[76]!==T||e[77]!==N?(S=(0,s.jsx)(D,{content:T,usePortal:!0,children:N}),e[76]=T,e[77]=N,e[78]=S):S=e[78],S}return null},C=r=>{let e=(0,P.c)(2),t;return e[0]===r.elapsedTime?t=e[1]:(t=(0,s.jsx)("span",{className:"tracking-wide font-semibold",children:r.elapsedTime}),e[0]=r.elapsedTime,e[1]=t),t};var me=r=>{let e=(0,P.c)(4),t=new Date(r.lastRanTime*1e3),d=new Date,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,hour12:!0},e[0]=l):l=e[0];let h=O(l),o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,hour12:!0},e[1]=o):o=e[1];let b=O(o),m=t.toDateString()===d.toDateString()?h:b,x=oe(t),_;return e[2]===x?_=e[3]:(_=(0,s.jsxs)("span",{className:"text-muted-foreground",children:["(",x," ago)"]}),e[2]=x,e[3]=_),(0,s.jsxs)("span",{children:["Ran at"," ",(0,s.jsx)("strong",{className:"tracking-wide font-semibold",children:m.format(t)})," ",_]})},he=r=>{let e=(0,P.c)(6),t;e[0]===r.startTime?t=e[1]:(t=r.startTime.toMilliseconds(),e[0]=r.startTime,e[1]=t);let d=ue(t),l;e[2]===d?l=e[3]:(l=W(d),e[2]=d,e[3]=l);let h;return e[4]===l?h=e[5]:(h=(0,s.jsx)("span",{children:l}),e[4]=l,e[5]=h),h};export{C as n,de as t};
1
+ import{s as H}from"./chunk-LvLJmgfZ.js";import{t as z}from"./react-Bj1aDYRI.js";import{an as W,in as R}from"./cells-CMc2NsXm.js";import{t as B}from"./compiler-runtime-B3qBwwSJ.js";import{g as L}from"./useEventListener-C0195JsF.js";import{t as V}from"./jsx-runtime-Blw4afVn.js";import{t as D}from"./tooltip-4bZlU7jl.js";import{t as k}from"./ban-DOUu3Y9Q.js";import{c as G,l as A,n as J,t as M}from"./toDate-Ct2FT81-.js";import{t as K}from"./ellipsis-C_B8Ux9M.js";import{t as Y}from"./refresh-cw-CYq4mK5a.js";import{t as Q}from"./workflow-e-XGaKyY.js";import{i as U,n as F,r as E,t as Z}from"./en-US-CjNeNXDB.js";import{t as O}from"./useDateFormatter-rtpVEy3J.js";import{t as I}from"./multi-icon-C2ijLyOs.js";function X(r,e){let t=M(r)-+M(e);return t<0?-1:t>0?1:t}function $(r){return J(r,Date.now())}function ee(r,e,t){let[d,l]=F(t==null?void 0:t.in,r,e),h=d.getFullYear()-l.getFullYear(),o=d.getMonth()-l.getMonth();return h*12+o}function te(r){return e=>{let t=(r?Math[r]:Math.trunc)(e);return t===0?0:t}}function se(r,e){return M(r)-+M(e)}function ae(r,e){let t=M(r,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function le(r,e){let t=M(r,e==null?void 0:e.in),d=t.getMonth();return t.setFullYear(t.getFullYear(),d+1,0),t.setHours(23,59,59,999),t}function ne(r,e){let t=M(r,e==null?void 0:e.in);return+ae(t,e)==+le(t,e)}function re(r,e,t){let[d,l,h]=F(t==null?void 0:t.in,r,r,e),o=X(l,h),b=Math.abs(ee(l,h));if(b<1)return 0;l.getMonth()===1&&l.getDate()>27&&l.setDate(30),l.setMonth(l.getMonth()-o*b);let m=X(l,h)===-o;ne(d)&&b===1&&X(d,h)===1&&(m=!1);let x=o*(b-+m);return x===0?0:x}function ie(r,e,t){let d=se(r,e)/1e3;return te(t==null?void 0:t.roundingMethod)(d)}function ce(r,e,t){let d=U(),l=(t==null?void 0:t.locale)??d.locale??Z,h=X(r,e);if(isNaN(h))throw RangeError("Invalid time value");let o=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:h}),[b,m]=F(t==null?void 0:t.in,...h>0?[e,r]:[r,e]),x=ie(m,b),_=(E(m)-E(b))/1e3,p=Math.round((x-_)/60),v;if(p<2)return t!=null&&t.includeSeconds?x<5?l.formatDistance("lessThanXSeconds",5,o):x<10?l.formatDistance("lessThanXSeconds",10,o):x<20?l.formatDistance("lessThanXSeconds",20,o):x<40?l.formatDistance("halfAMinute",0,o):x<60?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",1,o):p===0?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",p,o);if(p<45)return l.formatDistance("xMinutes",p,o);if(p<90)return l.formatDistance("aboutXHours",1,o);if(p<1440){let g=Math.round(p/60);return l.formatDistance("aboutXHours",g,o)}else{if(p<2520)return l.formatDistance("xDays",1,o);if(p<43200){let g=Math.round(p/G);return l.formatDistance("xDays",g,o)}else if(p<43200*2)return v=Math.round(p/A),l.formatDistance("aboutXMonths",v,o)}if(v=re(m,b),v<12){let g=Math.round(p/A);return l.formatDistance("xMonths",g,o)}else{let g=v%12,u=Math.trunc(v/12);return g<3?l.formatDistance("aboutXYears",u,o):g<9?l.formatDistance("overXYears",u,o):l.formatDistance("almostXYears",u+1,o)}}function oe(r,e){return ce(r,$(r),e)}var q=H(z(),1);function ue(r){let e=(0,q.useRef)(r),[t,d]=(0,q.useState)(r);return(0,q.useEffect)(()=>{let l=setInterval(()=>{d(R.now().toMilliseconds())},17);return()=>clearInterval(l)},[]),t-e.current}var P=B(),s=H(V(),1);const de=r=>{let e=(0,P.c)(79),{editing:t,status:d,disabled:l,staleInputs:h,edited:o,interrupted:b,elapsedTime:m,runStartTimestamp:x,lastRunStartTimestamp:_,uninstantiated:p}=r;if(!t)return null;let v=x??_,g;e[0]===v?g=e[1]:(g=v?(0,s.jsx)(me,{lastRanTime:v}):null,e[0]=v,e[1]=g);let u=g;if(l&&d==="running")return L.error("CellStatusComponent: disabled and running"),null;if(l&&h){let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is stale, but it's disabled and can't be run"}),e[2]=c):c=e[2];let a;e[3]===u?a=e[4]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[3]=u,e[4]=a);let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:(0,s.jsxs)(I,{children:[(0,s.jsx)(k,{className:"h-5 w-5",strokeWidth:1.5}),(0,s.jsx)(Y,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[5]=i):i=e[5];let n;return e[6]===a?n=e[7]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[6]=a,e[7]=n),n}if(l){let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is disabled"}),e[8]=c):c=e[8];let a;e[9]===u?a=e[10]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[9]=u,e[10]=a);let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-disabled","data-testid":"cell-status","data-status":"disabled",children:(0,s.jsx)(k,{className:"h-5 w-5",strokeWidth:1.5})}),e[11]=i):i=e[11];let n;return e[12]===a?n=e[13]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[12]=a,e[13]=n),n}if(!h&&d==="disabled-transitively"){let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"An ancestor of this cell is disabled, so it can't be run"}),e[14]=c):c=e[14];let a;e[15]===u?a=e[16]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[15]=u,e[16]=a);let i;e[17]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"disabled-transitively",children:(0,s.jsxs)(I,{layerTop:!0,children:[(0,s.jsx)(Q,{className:"h-5 w-5",strokeWidth:1.5}),(0,s.jsx)(k,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[17]=i):i=e[17];let n;return e[18]===a?n=e[19]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[18]=a,e[19]=n),n}if(h&&d==="disabled-transitively"){let c;e[20]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is stale, but an ancestor is disabled so it can't be run"}),e[20]=c):c=e[20];let a;e[21]===u?a=e[22]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[21]=u,e[22]=a);let i;e[23]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:(0,s.jsxs)(I,{children:[(0,s.jsx)(Y,{className:"h-5 w-5",strokeWidth:1}),(0,s.jsx)(k,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[23]=i):i=e[23];let n;return e[24]===a?n=e[25]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[24]=a,e[25]=n),n}if(d==="running"){let c;e[26]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is running"}),e[26]=c):c=e[26];let a;e[27]===u?a=e[28]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[27]=u,e[28]=a);let i;e[29]===x?i=e[30]:(i=R.fromSeconds(x)||R.now(),e[29]=x,e[30]=i);let n;e[31]===i?n=e[32]:(n=(0,s.jsx)("div",{className:"cell-status-icon elapsed-time running","data-testid":"cell-status","data-status":"running",children:(0,s.jsx)(he,{startTime:i})}),e[31]=i,e[32]=n);let f;return e[33]!==a||e[34]!==n?(f=(0,s.jsx)(D,{content:a,usePortal:!0,children:n}),e[33]=a,e[34]=n,e[35]=f):f=e[35],f}if(d==="queued"){let c;e[36]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is queued to run"}),e[36]=c):c=e[36];let a;e[37]===u?a=e[38]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[37]=u,e[38]=a);let i;e[39]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-queued","data-testid":"cell-status","data-status":"queued",children:(0,s.jsx)(K,{className:"h-5 w-5",strokeWidth:1.5})}),e[39]=i):i=e[39];let n;return e[40]===a?n=e[41]:(n=(0,s.jsx)(D,{content:a,usePortal:!0,children:i}),e[40]=a,e[41]=n),n}if(o||b||h||p){let c;e[42]===m?c=e[43]:(c=W(m),e[42]=m,e[43]=c);let a=c,i;e[44]!==m||e[45]!==a?(i=m?(0,s.jsx)(C,{elapsedTime:a}):null,e[44]=m,e[45]=a,e[46]=i):i=e[46];let n=i,f,T="";if(p)f="This cell has not yet been run";else if(b){f="This cell was interrupted when it was last run";let j;e[47]===n?j=e[48]:(j=(0,s.jsxs)("span",{children:["This cell ran for ",n," before being interrupted"]}),e[47]=n,e[48]=j),T=j}else if(o){f="This cell has been modified since it was last run";let j;e[49]===n?j=e[50]:(j=(0,s.jsxs)("span",{children:["This cell took ",n," to run"]}),e[49]=n,e[50]=j),T=j}else{f="This cell has not been run with the latest inputs";let j;e[51]===n?j=e[52]:(j=(0,s.jsxs)("span",{children:["This cell took ",n," to run"]}),e[51]=n,e[52]=j),T=j}let N;e[53]===Symbol.for("react.memo_cache_sentinel")?(N=(0,s.jsx)("div",{className:"cell-status-stale","data-testid":"cell-status","data-status":"outdated",children:(0,s.jsx)(Y,{className:"h-5 w-5",strokeWidth:1.5})}),e[53]=N):N=e[53];let S;e[54]===f?S=e[55]:(S=(0,s.jsx)(D,{content:f,usePortal:!0,children:N}),e[54]=f,e[55]=S);let y;e[56]!==m||e[57]!==a||e[58]!==u||e[59]!==T?(y=m&&(0,s.jsx)(D,{content:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[T,u]}),usePortal:!0,children:(0,s.jsx)("div",{className:"elapsed-time hover-action","data-testid":"cell-status","data-status":"outdated",children:(0,s.jsx)("span",{children:a})})}),e[56]=m,e[57]=a,e[58]=u,e[59]=T,e[60]=y):y=e[60];let w;return e[61]!==S||e[62]!==y?(w=(0,s.jsxs)("div",{className:"cell-status-icon flex items-center gap-2",children:[S,y]}),e[61]=S,e[62]=y,e[63]=w):w=e[63],w}if(m!==null){let c;e[64]===m?c=e[65]:(c=W(m),e[64]=m,e[65]=c);let a=c,i;e[66]!==m||e[67]!==a?(i=m?(0,s.jsx)(C,{elapsedTime:a}):null,e[66]=m,e[67]=a,e[68]=i):i=e[68];let n=i,f;e[69]===n?f=e[70]:(f=(0,s.jsxs)("span",{children:["This cell took ",n," to run"]}),e[69]=n,e[70]=f);let T;e[71]!==u||e[72]!==f?(T=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[f,u]}),e[71]=u,e[72]=f,e[73]=T):T=e[73];let N;e[74]===a?N=e[75]:(N=(0,s.jsx)("div",{className:"cell-status-icon elapsed-time hover-action","data-testid":"cell-status","data-status":"idle",children:(0,s.jsx)("span",{children:a})}),e[74]=a,e[75]=N);let S;return e[76]!==T||e[77]!==N?(S=(0,s.jsx)(D,{content:T,usePortal:!0,children:N}),e[76]=T,e[77]=N,e[78]=S):S=e[78],S}return null},C=r=>{let e=(0,P.c)(2),t;return e[0]===r.elapsedTime?t=e[1]:(t=(0,s.jsx)("span",{className:"tracking-wide font-semibold",children:r.elapsedTime}),e[0]=r.elapsedTime,e[1]=t),t};var me=r=>{let e=(0,P.c)(4),t=new Date(r.lastRanTime*1e3),d=new Date,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,hour12:!0},e[0]=l):l=e[0];let h=O(l),o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,hour12:!0},e[1]=o):o=e[1];let b=O(o),m=t.toDateString()===d.toDateString()?h:b,x=oe(t),_;return e[2]===x?_=e[3]:(_=(0,s.jsxs)("span",{className:"text-muted-foreground",children:["(",x," ago)"]}),e[2]=x,e[3]=_),(0,s.jsxs)("span",{children:["Ran at"," ",(0,s.jsx)("strong",{className:"tracking-wide font-semibold",children:m.format(t)})," ",_]})},he=r=>{let e=(0,P.c)(6),t;e[0]===r.startTime?t=e[1]:(t=r.startTime.toMilliseconds(),e[0]=r.startTime,e[1]=t);let d=ue(t),l;e[2]===d?l=e[3]:(l=W(d),e[2]=d,e[3]=l);let h;return e[4]===l?h=e[5]:(h=(0,s.jsx)("span",{children:l}),e[4]=l,e[5]=h),h};export{C as n,de as t};